<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.csd.helper.IConstant"%>
<%@page import="com.csd.helper.ProjectState"%>
<%@page import="com.csd.vo.UserVO"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

HttpSession s = request.getSession();
UserVO uvo =  (UserVO)s.getAttribute(IConstant.userVO);
if(uvo==null || !uvo.getType().equals(IConstant.managerRole) )
{
	response.sendRedirect(path+"/admin/coreDataManage_error.jsp?info=Sorry, you ware not login, yet!");
	return;
}

%>

<%@ include file="databaseManage_login.jsp"%>
<%@ include file="databaseManage_functions.jsp"%>
<%
if (con==null)
{
	response.sendRedirect(path+"/admin/coreDataManage_error.jsp?info=Sorry, you ware not login, yet!");
}

String server=Host;
    
PreparedStatement pstm = con.prepareStatement("SHOW DATABASES");
ResultSet rst = pstm.executeQuery();
	        
String db= null;
if( db == null )
{
	db =  new String();
    while (rst.next()) {
       if(rst.getString(1).equals("rpms"))
       {
       		db = rst.getString(1);
       }
    }
    rst.close();
}

   

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理员左侧菜单</title>
<link href="<%=path%>/admin/css/admin_left.css" rel="stylesheet" type="text/css" />
</head>

<body>
    <div class="main">
        <div class="menu">
        	<ul>
                  <li class="top"><a href="<%=path%>/admin/index.jsp" target="_parent">返回上级菜单</a></li>
                  <%if(db != null) {%>
                  <li class="top"><a href="<%=path %>/admin/databaseManage_enterDatabase.jsp?server=<%=server%>&amp;db=<%=db%>" target="admin_jspadmin_right">进入数据库</a></li>
                  <%}else{ %>
                  <li class="top"><a >无法连接数据库</a></li>
                  <%} %>
            </ul>              
        </div>
    </div>
</body>
</html>
